<?php require_once('../Connections/locale.php'); ?>
<?php
mysql_select_db($database_locale, $locale);
$query_riviste = "SELECT * FROM riviste";
$riviste = mysql_query($query_riviste, $locale) or die(mysql_error());
$row_riviste = mysql_fetch_assoc($riviste);
$totalRows_riviste = mysql_num_rows($riviste);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<link href="../style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<form id="form1" name="form1" method="post" action="addebiti_per_competenze.php"><fieldset>
<legend>Addebiti Per Competenze</legend>
    <p>
      <label>Anno
      <select name="anno" id="anno">
        <option value="2010">2010</option>
        <option value="2009">2009</option>
        <option value="2008">2008</option>
        <option value="2007" selected="selected">2007</option>
        <option value="2006">2006</option>
        <option value="2005">2005</option>
        <option value="2004">2004</option>
        <option value="2003">2003</option>
        <option value="2002">2002</option>
        <option value="2001">2001</option>
        <option value="2000">2000</option>
      </select>
      </label>
      <label>Rivista
      <select name="id_rivista" id="id_rivista">
        <?php
do {  
?>
        <option value="<?php echo $row_riviste['id_rivista']?>"><?php echo $row_riviste['descrizione']?></option>
        <?php
} while ($row_riviste = mysql_fetch_assoc($riviste));
  $rows = mysql_num_rows($riviste);
  if($rows > 0) {
      mysql_data_seek($riviste, 0);
	  $row_riviste = mysql_fetch_assoc($riviste);
  }
?>
      </select>
      </label>
      <label>
      <input type="submit" name="Submit" value="Submit" />
      </label>
    </p>
</fieldset>
</form>
</body>
</html>
<?php
mysql_free_result($riviste);
?>
